<?php
App::uses('AppModel', 'Model');
/**
 * UF Model
 *
 * @property Regiao $REGIAO
 * @property Cidade $CIDADE
 * @property Medico $MEDICO
 * @property ResponsavelTecnicoTecnicoLibExame $TBRESPONSAVELTECNICOLIBEXAME
 */
class Uf extends AppModel {

/**
 * Use table
 *
 * @var mixed False or table name
 */
	public $useTable = 'UF';

/**
 * Primary key field
 *
 * @var string
 */
	public $id = 'CD_UF';
	public $primaryKey = 'CD_UF';

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'CD_UF' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'NM_UF' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'CD_REG' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'CD_UF_IBGE' => array(
			'alphanumeric' => array(
				'rule' => array('alphanumeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'REGIAO' => array(
			'className' => 'Regiao',
			'foreignKey' => 'CD_REG',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

/**
 * hasMany associations
 *
 * @var array
 */
	public $hasMany = array(
		'Cidade' => array(
			'className' => 'Cidade',
			'foreignKey' => 'CD_UF',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
            /*
		'Medico' => array(
			'className' => 'Medico',
			'foreignKey' => 'CD_CRM',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),*/
		'ResponsavelTecnicoLibExame' => array(
			'className' => 'ResponsavelTecnicoLibExame',
			'foreignKey' => 'UF_CONSELHO',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
